<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="cn.biwysh.exam.entity.User"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
User user=null;
if (session.getAttribute("userqt") != null) {
	user = (User) session.getAttribute("userqt");
}
String jspName="";
if (request.getParameter("jspName") != null) {
	jspName = request.getParameter("jspName") ;
}
String cid="";
if (request.getParameter("cid") != null) {
	cid = request.getParameter("cid") ;
}
boolean isError=true;
if (request.getParameter("error") != null)
{
	isError=false;
}
String target="";
if(request.getRequestURI().indexOf("index.jsp")>-1){
	target=" target='_blank'  ";
}
boolean isFromMore=false;
if(request.getRequestURI().indexOf("tglist")>-1){
	isFromMore=true;
}else if(request.getRequestURI().indexOf("zslist")>-1){
	isFromMore=true;
}else if(request.getRequestURI().indexOf("zsmore")>-1){
	isFromMore=true;
}
%>
<style type="text/css">
*{
    padding: 0;
}
<!-- 
#top1{
  width:942px;
}
#top11{
  width:312px;
  height:81px;
  background: url(img/qt/01.jpg);
  float:left;
}
#top12{
  width:315px;
  height:81px;
  background: url(img/qt/02.jpg);
  float:left;
}
#top13{
  width:315px;
  height:81px;
  background: url(img/qt/03.jpg);
  float:left;
}
#top2{
  width:947px;
}
#top21{
  width:9px;
  height:38px;
  background: url(img/qt/dlzuo.jpg);
  float:left;
}
#top22{
  width:922px;
  height:38px;
  background: url(img/qt/dlzhong.jpg);
  float:left;
}
#top23{
  width:16px;
  height:38px;
  background: url(img/qt/dlyou.jpg);
  float:left;
}
#datenow{
  font-size: 12px;
  font-weight: bolder;
  display:block;
  margin:20px 0 0 80px;
}
#login{
 text-align:left;
 float:left;
}
#login table{
  float:left;
  margin-left:10px;
}
.liename{
 background: url(img/qt/04.jpg) no-repeat;
 background-position:5px 12px;
 width:90px;
 height:35px;
 font-size:15px;
 font-family:"Microsoft YaHei";
 font-weight:bolder;
 padding-top:5px;
}
.yhm{
 background: url(img/qt/yhm.jpg) no-repeat;
 background-position:5px 12px;
 width:70px;
 height:35px;
 font-size:12px;
 font-family:"Microsoft YaHei";
 text-align:right;
  padding-top:5px;
}
.pwd{
 background: url(img/qt/pwd.jpg) no-repeat;
 background-position:12px 12px;
 width:70px;
 height:35px;
 font-size:12px;
 font-family:"Microsoft YaHei";
 text-align:right;
  padding-top:5px;
}
#uname,#pwd{
  width:130px;
  text-align: left;
}
.link{
 height:35px;
 padding:5px 0 0 30px;
 font-size:12px;
 font-family:"Microsoft YaHei";
}
.alerdin{
 height:35px;
 padding-top:5px;
 font-size:12px;
 font-family:"Microsoft YaHei";
 text-align:left;
}
.shuru{
 height:35px;
 padding-top:5px;
}
.clear{
  clear: both;
}
#fullbg{
background-color: #000;
display:none;
z-index:2000;
position:absolute;
left:0px;
top:0px;
filter:Alpha(Opacity=30);
/* IE */
-moz-opacity:0.3; 
/* Moz + FF */
opacity: 0.3; 
}
.opendiv{
	position: absolute;
	display: none;
	z-index: 2001;
	width: 410px;
	height: 203px;
	top: 50%;
    left: 50%;
    margin: -101px auto auto -205px; /* 设置弹出层绝对居中 */
  }
.hzuo{
   width:14px;
   height:203px;
   background: url(img/qt/hzuo.png);
   float:left;
}
.hzhong{
   width:378px;
   height:203px;
   background: url(img/qt/hzhong.png);
   float:left;
}
.hyou{
   width:16px;
   height:203px;
   background: url(img/qt/hyou.png);
   float:left;
}
.tanhao{
   width:378px;
   height:203px;
   background: url(img/qt/tanhao.jpg) no-repeat;
   background-position: 40px 0px;
}
*html .tanhao{background-position: 40px 40px; }
.tanhao td{
 text-align:left;
 color:#fca245;
}
-->
</style>
<script type="text/javascript">
 function getTime(){
	 var myDate = new Date();  
	 document.getElementById("datenow").innerText = myDate.getFullYear()+"年"+(myDate.getMonth()+1)+"月"+myDate.getDate()+"日  "+getWeek(myDate.getDay())+" "+myDate.getHours()+":"+(myDate.getMinutes()<10?"0"+myDate.getMinutes():myDate.getMinutes());
	 }
 function getWeek(day){
        switch(day){
        case 0:return "星期日";
        case 1:return "星期一";
        case 2:return "星期二";
        case 3:return "星期三";
        case 4:return "星期四";
        case 5:return "星期五";
        case 6:return "星期六";
        }
	 }
 function ReTime(){
	 setInterval("getTime();",1000); 
 }
 function error(){
   <% if(!isError){%>
      alert("用户名或密码不正确！");
   <% }%>
}
function login(){
	var uname=document.getElementById("uname").value;
	var pwd=document.getElementById("pwd").value;
	if(uname.length<1){
      alert("用户名不能为空！");
	  return false;
	}
	if(pwd.length<1){
	      alert("密码不能为空！");
		  return false;
		}
	document.loginform.submit();
}
function Logout(){
	document.loginform.submit();
}
//======出现弹出框========
function openBgKuang(){
	//加载遮罩
	var heights=document.body.clientHeight;
	var bW=$("body").width();
	if(window.ActiveXObject){
	  bW=$("body").width()-22;
    }
	$("#fullbg").css({width:bW,height:heights+"px",display:"block"});
	$("#showpanel").css({display:"block"});
	return false;
}
function closeShow(){
	$("#fullbg").css({display:"none"});
	$("#showpanel").css({display:"none"});
}
//======出现弹出框结束========
</script>
<body onload="ReTime(); error();">
       <div id="top1">
          <div id="top11"></div>
          <div id="top12"></div>
          <div id="top13">
           <span id="datenow"></span>
          </div>
       </div>
       <div id="top2">
          <div id="top21"></div>
          <div id="top22">
              <%if(user!=null){ %>
             <form name="loginform" method="post" action="logout.do">
              <%}else{%>
              <form name="loginform" method="post" action="login.do">
             <%}%>
             <div id="login">
               <input name="pname" type="hidden" value="<%=jspName %>">
               <input name="cid" type="hidden" value="<%=cid %>">
               <table cellpadding="0" cellspacing="0">
               <tr>
               <%if(user!=null){ %>
                  <%if(!isFromMore) {%>
                      <td class="alerdin" style="width:500px;"><span style="color:#FF972C;"><%=user.getUname() %></span>&nbsp; 您好！欢迎您使用舟山电力信息技能知识库平台。</td>
	                  <%if(jspName.equals("self")){%>
	                	 <td class="alerdin" style="width:100px;"><a href="#"style="color:#F9972A;" onclick="return false;">个人资料</a></td>
	                 <%}else{%>
	                	  <td class="alerdin" style="width:100px;"><a href="self.do" style="color:black;" >个人资料</a></td>
	                 <%} %>
	                 <%if(jspName.equals("mykh")){%>
	                	 <td class="alerdin" style="width:120px;"><a href="#"style="color:#F9972A;" onclick="return false;">我的考核系统</a></td>
	                 <%}else{%>
	                	 <td class="alerdin" style="width:120px;"><a href="mykh.do"  style="color:black; " >我的考核系统</a></td>
	                 <%} %>
	                 <%if(jspName.equals("zdyzsk")){%>
	                	 <td class="alerdin" style="width:100px;"><a href="#" style="color:#F9972A;" onclick="return false;">定制知识库</a></td>
	                 <%}else{%>
	                	 <td class="alerdin" style="width:100px;"><a href="zdyzsk.do"  style="color:black;" >定制知识库</a></td>
	                 <%} %>
	                  <%if(target.length()>0){ %>
		                 <td class="alerdin"><span style="color:black;cursor:pointer;" onclick="Logout()">退出</span></td>
		                 <%}else{%>
		                  <td class="alerdin"><a style="color:black;text-decoration: none;" href="index.do">返回首页</a></td> 
	                 	 <%} %>
                 <% }else{%>
                     <td class="alerdin" style="width:820px;"><span style="color:#FF972C;"><%=user.getUname() %></span>&nbsp; 您好！欢迎您使用舟山电力信息技能知识库平台。</td>
                	 <td class="alerdin"><a style="color:black;text-decoration: none;" href="javascript:window.close()">关闭</a></td> 
                 <%}%>
                
               <%}else{ %>
                <%if(!isFromMore) {%>
	                 <td class="liename">用户登录</td>
	                 <td class="yhm">用户名：</td>
	                 <td class="shuru"><input id="uname" name="uname" maxlength="20"/></td>
	                 <td class="pwd">密 码：</td>
	                 <td class="shuru"><input id="pwd" name="pwd" type="password" maxlength="20"/></td>
	                 <td class="shuru"><img alt="" onclick="login()" style="cursor:pointer;margin-left:10px;margin-top:1px;" src="img/qt/login.jpg"></td>
	                 <td class="link"><a href="#" style="color:black;" onclick="openBgKuang();return false;">忘记密码</a></td>
	                 <td class="link"><a href="nmks.do" target="_blank">匿名测试</a></td>
                 <%}else{%>
                	 <td class="alerdin" style="width:820px;"><span style="color:#FF972C;">匿名用户</span>&nbsp; 您好！欢迎您使用舟山电力信息技能知识库平台。</td>
                	 <td class="alerdin"><a style="color:black;text-decoration: none;" href="javascript:window.close()">关闭</a></td> 
                 <%}%>
               <%}%>
               </tr>
               </table>
             </div>
             </form>
          </div>
          <div id="top23"></div>
       </div>
       <div id="fullbg"></div>
       <div id="showpanel" class="opendiv">
       <div class="hzuo"></div>
       <div class="hzhong">
         <div class="tanhao">
           <table style="margin:50px 0 0 130px;" cellpadding="0" cellspacing="0">
              <tr><td style="font-size: 18px;">请联系管理员</td></tr>
              <tr><td style="font-size: 14px;padding-top:10px;">电话：56726672</td></tr>
              <tr><td style="font-size: 14px;padding-top:10px;">E-mail：zhoushanpingtao@zsdl.com</td></tr>
              <tr><td style="padding:15px 0 0 30px;"><img src="img/qt/fanhui.jpg"/ class="button" onclick="closeShow()"></td></tr>
           </table>
         </div>
       </div>
       <div class="hyou"></div>
	   </div>
</body>